<div class="content-wrapper">
    <section class="content-header">
        <h1>订单详情</h1>
        <ol class="breadcrumb">
            <li><a href="/"><i class="fa fa-dashboard"></i> 首页</a></li>
            <li class="active">订单管理</li>
            <li class="active">订单详情</li>
        </ol>
    </section>
    <section class="content">
        <div class="row">
            <div class="col-md-12">
                <div class="nav-tabs-custom">
                    <ul class="nav nav-tabs">
                        <li class="active"><a href="#order" data-toggle="tab">订单信息</a></li>
                        <li><a href="#goods" data-toggle="tab">订单商品</a></li>
                    </ul>
                    <div class="tab-content">
                        <div class="active tab-pane" id="order">
                            <div class="row">
                                <div class="col-md-12">
                                    <div class="box box-primary">
                                        <div class="box-body box-profile">
                                            <div class="col-md-6">
                                                <ul class="list-group list-group-unbordered">
                                                    <input type="hidden" class="order_id" id="order_id" value="{$orderInfo.order_id}"/>
                                                    <li class="list-group-item"><b>订单ID</b> <span class="pull-right">{$orderInfo.order_id}</span></li>
                                                    <li class="list-group-item"><b>订单编号</b> <span class="pull-right">{$orderInfo.order_code}</span></li>
                                                    <li class="list-group-item"><b>公司</b> <span class="pull-right">{$orderInfo.company_name}</span></li>
                                                    <li class="list-group-item"><b>渠道公司</b> <span class="pull-right">{$orderInfo.ditch_company}</span></li>
                                                    <li class="list-group-item"><b>代理公司</b> <span class="pull-right">{$orderInfo.agent_name}</span></li>
                                                    <li class="list-group-item"><b>联系人</b> <span class="pull-right">{$orderInfo.name}</span></li>
                                                    <li class="list-group-item"><b>联系方式</b>
                                                        <div class="panel panel-info">
                                                            <table class="table">
                                                                <foreach name="orderInfo.contact_info" item="contact" key="k">
                                                                    <tr><td>{$k}</td><td>{$contact}</td></tr>
                                                                </foreach>
                                                            </table>
                                                        </div>
                                                    </li>
                                                    <li class="list-group-item"><b>推广产品/游戏</b> <span class="pull-right">{$orderInfo.product_name}</span></li>
                                                    <li class="list-group-item"><b>一级产品</b> <span class="pull-right">{$orderInfo.first_name}</span></li>
                                                    <li class="list-group-item"><b>业务员</b> <span class="pull-right">{$orderInfo.admin_name}</span></li>
                                                    <li class="list-group-item"><b>部门</b> <span class="pull-right">{$orderInfo.department_name}</span></li>
                                                    <li class="list-group-item"><b>下单时间</b> <span class="pull-right">{$orderInfo.create_time}</span></li>
                                                    <li class="list-group-item"><b>订单状态</b> <span class="pull-right">{$orderInfo.status_desc}</span></li>
                                                </ul>
                                            </div>
                                            <div class="col-md-6">
                                                <ul class="list-group list-group-unbordered">
                                                    <li class="list-group-item"><b>是否到账</b> <span class="pull-right">
                                                        <if condition="$orderInfo.is_pay eq 0">未到账<else />已到账</if>
                                                    </span></li>
                                                    <li class="list-group-item"><b>终端客户</b> <span class="pull-right">{$orderInfo.company_name}</span></li>
                                                    <li class="list-group-item"><b>账期</b> <span class="pull-right">{$orderInfo.pay_interval}个月</span></li>
                                                    <li class="list-group-item"><b>公司名（代理商）</b> <span class="pull-right">{$orderInfo.agent_name}</span></li>
                                                    <li class="list-group-item"><b>渠道公司</b> <span class="pull-right">{$orderInfo.ditch_company}</span></li>
                                                    <li class="list-group-item"><b>销售金额</b> <span class="pull-right">{$orderInfo.amount}</span></li>
                                                    <li class="list-group-item"><b>报价</b> <span class="pull-right">{$orderInfo.quoted_price}</span></li>
                                                    <li class="list-group-item"><b>毛利</b> <span class="pull-right">{$orderInfo.profit_price}</span></li>
                                                    <li class="list-group-item"><b>其他费用</b> <span class="pull-right">{$orderInfo.other_price}</span></li>
                                                    <li class="list-group-item"><b>合同文件</b>
                                                        <span class="pull-right">
													<php>if($orderInfo['order_bill']['contract']){</php>
														<a href='{$orderInfo.order_bill.contract}' target="_blank">预览</a>
													<php>}else{</php>
														暂无
													<php>}</php>
													</span>
                                                    </li>
                                                    <li class="list-group-item"><b>发票文件</b>
                                                        <span class="pull-right">
													<php>if($orderInfo['order_bill']['bill']){</php>
														<a href='{$orderInfo.order_bill.bill}' target="_blank">预览</a>
													</span>
                                                        <php>}else{</php>
                                                        暂无
                                                        <php>}</php>
                                                        </span>
                                                    </li>
                                                </ul>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="tab-pane" id="goods">
                            <div class="row">
                                <div class="col-md-12">
                                    <div class="box box-primary">
                                        <div class="box-body">
                                            <table class="table table-bordered">
                                                <thead>
                                                    <th>产品名称</th>
                                                    <th>报价类型</th>
                                                    <th>广告主</th>
                                                    <th>推广产品</th>
                                                    <th>所属行业</th>
                                                    <th>投放端&位置</th>
                                                    <th>投放广告位</th>
                                                    <th>投放吧</th>
                                                    <th>投放时间</th>
                                                    <th>报价</th>
                                                    <th>报价详情</th>
                                                </thead>
                                                <tbody id="itemList-b">
                                                <if condition="count($orderInfo.itemList) eq 0 "><tr><td colspan="11">暂未添加</td></tr></if>
                                                <foreach name="orderInfo.itemList" item="item" key="key">
                                                    <tr>
                                                        <td>{$item.first_name}-{$item.second_name}-{$item.item_name}</td>
                                                        <td>
                                                            <if condition="$item.quoted_type eq 1 ">
                                                                <span class="label label-success">预估报价</span>
                                                                <elseif condition="$item.quoted_type eq 2" />
                                                                <span class="label label-info">百度询价</span>
                                                                <else />
                                                                <span class="label label-default">不询价</span>
                                                            </if>

                                                        </td>
                                                        <td>{$item.advertiser}</td>
                                                        <td>{$item.promote_product}</td>
                                                        <td>{$item.trade}</td>
                                                        <td>{$item.port}</td>
                                                        <td>{$item.place}</td>
                                                        <td>{$item.post_bar}</td>
                                                        <td>{$item.put_time}</td>
                                                        <td>{$item.total_price}</td>
                                                        <td>
                                                            <if condition="$item.quoted_file neq ''">
                                                                <a type="button" class="btn btn-sm btn-primary" href="/admin/index/downloadFile?file={$item.quoted_file|urlencode}"><i class="fa fa-cloud-download"></i>详情</a>
                                                                <else />
                                                                <label class="label label-default">暂未上传</label>
                                                            </if>
                                                        </td>
                                                    </tr>
                                                </foreach>
                                                </tbody>
                                            </table>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
</div>
<script src="{:load_js('/AdminLTE/plugins/layer/layer')}"></script>